home *** CD-ROM | disk | FTP | other *** search
- Path: news.une.edu.au!usenet
- From: Jon Snow <jwilkie@turing.une.edu.au>
- Newsgroups: comp.lang.c++
- Subject: Re: newing char**
- Date: 11 Feb 1996 23:03:43 GMT
- Organization: University of New England
- Message-ID: <4flskf$2i3@grivel.une.edu.au>
- References: <4fggal$4pf@darkstar.UCSC.EDU> <4fje7o$dl2@Milpitas01.Pop.Internex.NET>
- NNTP-Posting-Host: turing.une.edu.au
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; OSF1 V2.0 alpha)
- X-URL: news:4fje7o$dl2@Milpitas01.Pop.Internex.NET
-
- Artyom@kansmen.com (Art Shelest) wrote:
- >In article <4fggal$4pf@darkstar.UCSC.EDU>,
- > jono@cse.ucsc.edu (Jonathan Gibbs) wrote:
- >>If I have the following declaration:
- >>
- >>char **name;
- >>
- >>The following line compiles fine with g++, but I get the following
- >>error on SGI's CC. Which is right?
- >>
- >>int num;
- >>name = new (char*)[num];
- >>for (int i=0; i < num; i++) {
- >> name = new char[25];
- >>} ^^^^^^^
- >
- >Maybe you meant name[i] = ...
- >
- > _Art.
-
- And don't forget to initialise num to something before:
- name = new (char*)[num];
-
- Regards Jon
-
-